package com.vecspace.sso.entity;

import java.util.Date;


/**
 * User entity.
 * 
 * @author MyEclipse Persistence Tools
 */

public class SSOUser implements java.io.Serializable {
	
	private static final long serialVersionUID = 6811466685998873077L;
	private Long id;
	private String loginId;
	private String loginIdLow;
	private String userName;
	private String password;
	private String jobNumber;
	private String sex;
	private Date birthday;
	private String ethnic;
	private String highestEducation;
	private String jobTitle;
	private String jobPost;
	private String nativePlace;
	private String mobile;
	private String tel;
	private String email;
	private String address;
	private Integer authTag;
	private String caKey;
	private String ipAddress;
	private String macAddress;
	private String districtCode;
	private Integer jobState;
	private Integer deleteFlag = 1;//删除标记  2表示已逻辑删除
	private String customId;
	private String remark;
	
	private Long deptId;
	// Constructors

	/** default constructor */
	public SSOUser() {
		
	}

	/** minimal constructor */
	public SSOUser(Long id) {
		this.id = id;
	}

	/** full constructor */
	public SSOUser(Long id, String loginId, String loginIdLow, String userName,String password, String weixinId,
			String jobNumber, String sex, Date birthday, String ethnic,
			String highestEducation, String jobTitle, String jobPost,
			String nativePlace, String mobile, String email, Integer authTag,String caKey) {
		this.id = id;
		this.loginId = loginId;
		this.loginIdLow = loginIdLow;
		this.userName = userName;
		this.password = password;
		this.weixinId = weixinId;
		this.jobNumber = jobNumber;
		this.sex = sex;
		this.birthday = birthday;
		this.ethnic = ethnic;
		this.highestEducation = highestEducation;
		this.jobTitle = jobTitle;
		this.jobPost = jobPost;
		this.nativePlace = nativePlace;
		this.mobile = mobile;
		this.email = email;
		this.authTag = authTag;
		this.caKey = caKey;
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getLoginId() {
		if(loginId != null)  /*用户名不区分大小写*/
			return this.loginId.toLowerCase();
		else return null;
	}

	public void setLoginId(String loginId) {
		if(loginId != null) {
			this.loginId = loginId.trim();
			this.loginIdLow = this.loginId.toLowerCase();/*用户名不区分大小写*/
		}
		else {
			this.loginId = null;
			this.loginIdLow = null;
		}
	}

	public String getLoginIdLow() {
		return loginIdLow;
	}

	public void setLoginIdLow(String loginIdLow) {
		this.loginIdLow = loginIdLow;
	}

	/**姓名*/
	public String getUserName() {
		return this.userName;
	}

	/**姓名*/
	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	/**工号*/
	public String getJobNumber() {
		return this.jobNumber;
	}

	/**工号*/
	public void setJobNumber(String jobNumber) {
		this.jobNumber = jobNumber;
	}

	/**性别*/
	public String getSex() {
		return this.sex;
	}

	/**性别*/
	public void setSex(String sex) {
		this.sex = sex;
	}

	public Date getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getEthnic() {
		return this.ethnic;
	}

	public void setEthnic(String ethnic) {
		this.ethnic = ethnic;
	}

	public String getHighestEducation() {
		return this.highestEducation;
	}

	public void setHighestEducation(String highestEducation) {
		this.highestEducation = highestEducation;
	}

	public String getJobTitle() {
		return this.jobTitle;
	}

	public void setJobTitle(String jobTitle) {
		this.jobTitle = jobTitle;
	}

	public String getJobPost() {
		return this.jobPost;
	}

	public void setJobPost(String jobPost) {
		this.jobPost = jobPost;
	}

	public String getNativePlace() {
		return this.nativePlace;
	}

	public void setNativePlace(String nativePlace) {
		this.nativePlace = nativePlace;
	}

	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Integer getAuthTag() {
		return this.authTag;
	}

	public void setAuthTag(Integer authTag) {
		this.authTag = authTag;
	}

	private String sex_Caption;
	public String getSex_Caption(){
		return sex_Caption;
	}
	public void setSex_Caption(String value){
		this.sex_Caption = value;
	}
	
	private String ethnic_Caption;
	public String getNation_Catpion(){
		return ethnic_Caption;
	}
	public void setNation_Catpion(String value){
		this.ethnic_Caption = value;
	}
	
	private String highestEducation_Caption;
	public String getHighestEducation_Caption(){
		return highestEducation_Caption;
	}
	public void setHighestEducation_Caption(String value){
		this.highestEducation_Caption = value;
	}
	
	private String jobTitle_Caption;
	public String getJobTitle_Caption(){
		return jobTitle_Caption;
	}
	public void setJobTitle_Caption(String value){
		this.jobTitle_Caption = value;
	}
	
	private String jobState_Caption;
	public String getJobState_Caption(){
		return jobState_Caption;
	}
	public void setJobState_Caption(String value){
		this.jobState_Caption = value;
	}
	
	private String nativePlace_Caption;
	public String getNativePlace_Caption(){
		return nativePlace_Caption;
	}
	/**籍贯*/
	public void setNativePlace_Caption(String value){
		this.nativePlace_Caption = value;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getCaKey() {
		return caKey;
	}

	public void setCaKey(String caKey) {
		this.caKey = caKey;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getIpAddress() {
		return ipAddress;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

	public String getMacAddress() {
		return macAddress;
	}

	public void setMacAddress(String macAddress) {
		this.macAddress = macAddress;
	}
	/**
	 * 行政区编码 
	 */
	public String getDistrictCode() {
		return districtCode;
	}

	/**
	 * 行政区编码 
	 */
	public void setDistrictCode(String districtCode) {
		this.districtCode = districtCode;
	}
	/** 2：删除*/
	public Integer getDeleteFlag() {
		if(deleteFlag == null)return 1;
		return deleteFlag;
	}

	/** 2：删除*/
	public void setDeleteFlag(Integer deleteFlag) {
		if(deleteFlag == null)deleteFlag = 1;
		this.deleteFlag = deleteFlag;
	}
	/**是否删除 getDeleteFlag==2*/
	public boolean isDeleted() {
		return deleteFlag != null && deleteFlag.intValue() == 2;
	}
	
	/**在职状态 0离职 1在职 2试用期 3实习期 */
	public Integer getJobState() {
		if(jobState == null)return 1;
		return jobState;
	}

	/**在职状态 0离职 1在职 2试用期 3实习期 */
	public void setJobState(Integer jobState) {
		if(jobState == null) jobState = 1;
		this.jobState = jobState;
	}

	public String getCustomId() {
		if("".equals(customId))return null;
		return customId;
	}

	public void setCustomId(String customId) {
		this.customId = customId;
	}
	
	private String weixinId;
	/**微信号*/
	public String getWeixinId(){
		return weixinId;
	}
	/**微信号*/
	public void setWeixinId(String value){
		this.weixinId = value;
	}

	private String ssoLoginId;
	/**企业内部统一用户管理系统的用户账号*/
	public String getSsoLoginId(){
		return ssoLoginId;
	}
	/**企业内部统一用户管理系统的用户账号*/
	public void setSsoLoginId(String value){
		this.ssoLoginId = value;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**部门ID，只有在按部门查询用户时才有值*/
	public Long getDeptId() {
		return deptId;
	}
	/**部门ID，只有在按部门查询用户时才有值*/
	public void setDeptId(Long deptId) {
		this.deptId = deptId;
	}

	@Override
	public int hashCode() {	
		if(id == null)return 0;
		return id.intValue();
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj == null)return false;
		if(id == null)return false;
		SSOUser oth = (SSOUser)obj;
		if(oth.id == null)return false;
		
		return id.intValue() == oth.id.intValue();
	}
}